/*
 * @Autor: 黄旗
 * @Date: 2021-12-17 08:32:30
 */
import request from '@/plugins/request';
import dayjs from 'dayjs';

// 对话文件列表
export function marketingdatadatalist(data) {
    let datas = { ...data };
    if(data.start_time) {
        datas.start_time = dayjs(data.start_time).format('YYYY-MM-DD');
        datas.end_time = dayjs(data.end_time).format('YYYY-MM-DD');
    }
    return request({
        url: '/v1/marketing/data/data-list',
        method: 'get',
        params: datas
    });
}

// 上传对话列表
export function marketingdataimportexcel(data) {
    return request({
        url: '/v1/marketing/data/import-excel',
        method: 'post',
        isUpload: true,
        data
    });
}

// 删除对话列表
export function marketingdatadeletedata(data) {
    return request({
        url: '/v1/marketing/data/delete-data',
        method: 'post',
        data
    });
}

// 检查是否存在重复对话列表数据
export function marketingdatacheckdata(data) {
    let datas = { ...data };
    if(data.date_time) {
        datas.date_time = dayjs(data.date_time).format('YYYY-MM-DD');
    }
    return request({
        url: '/v1/marketing/data/check-data',
        method: 'get',
        params: datas
    });
}

// 对话列表
export function marketingdatadialoguelist(data) {
    let datas = { ...data };
    if(data.start_time) {
        datas.start_time = dayjs(data.start_time).format('YYYY-MM-DD');
        datas.end_time = dayjs(data.end_time).format('YYYY-MM-DD');
    }
    return request({
        url: '/v1/marketing/data/dialogue-list',
        method: 'get',
        params: datas
    });
}

// 渠道列表
export function marketingdataconfiglist(data) {
    return request({
        url: '/v1/marketing/data/config-list',
        method: 'get',
        params: data
    });
}

// 新增编辑默认渠道
export function marketingdataupdateconfigdefault(data) {
    return request({
        url: '/v1/marketing/data/update-config-default',
        method: 'post',
        data
    });
}

// 新增编辑渠道配置
export function marketingdataupdateconfig(data) {
    return request({
        url: '/v1/marketing/data/update-config',
        method: 'post',
        data
    });
}

// 删除渠道配置
export function marketingdatadeleteconfig(data) {
    return request({
        url: '/v1/marketing/data/delete-config',
        method: 'post',
        data
    });
}

// 删除默认渠道配置
export function marketingdatadeleteconfigdefault(data) {
    return request({
        url: '/v1/marketing/data/delete-config-default',
        method: 'post',
        data
    });
}

// 一级渠道列表备注：周期渠道接口
export function marketingconsumegetchannel(data) {
    return request({
        url: '/v1/marketing/consume/get-channel',
        method: 'get',
        params: data
    });
}

// 新增编辑日消费
export function marketingconsumeupdateconsume(data) {
    return request({
        url: '/v1/marketing/consume/update-consume',
        method: 'post',
        data
    });
}

// 新增编辑平均日消费
export function marketingconsumeupdateconsumemonth(data) {
    return request({
        url: '/v1/marketing/consume/update-consume-month',
        method: 'post',
        data
    });
}

// 日消费详情
export function marketingconsumegetconsume(data) {
    return request({
        url: '/v1/marketing/consume/get-consume',
        method: 'get',
        params: data
    });
}

// 平均日消费详情
export function marketingconsumegetconsumemonth(data) {
    return request({
        url: '/v1/marketing/consume/get-consume-month',
        method: 'get',
        params: data
    });
}

// 消费列表
export function marketingconsumeconsumelist(data) {
    let datas = { ...data };
    if(data.start_time) {
        datas.start_time = dayjs(data.start_time).format('YYYY-MM-DD');
        datas.end_time = dayjs(data.end_time).format('YYYY-MM-DD');
    }
    return request({
        url: '/v1/marketing/consume/consume-list',
        method: 'get',
        params: datas
    });
}
// 渠道列表
export function marketingconsumegetsourcechannellist(data) {
    return request({
        url: '/v1/marketing/consume/get-source-channel-list',
        method: 'get',
        params: data
    });
}
// 营销报表渠道
export function projectCondition(data) {
    return request({
        url: '/v1/marketing/consume/project-condition',
        method: 'get',
        params: data
    });
}
// 营销报表
export function marketingconsumeconsumereport(data) {
    let datas = { ...data };
    if(data.start_time) {
        datas.start_time = dayjs(data.start_time).format('YYYY-MM-DD');
        datas.end_time = dayjs(data.end_time).format('YYYY-MM-DD');
    }
    return request({
        url: '/v1/marketing/consume/consume-report',
        method: 'get',
        params: datas
    });
}
// 营销报表新差值详情
export function yxchangeDiff(data) {
    return request({
        url: '/v1/marketing/consume/yx-change-diff',
        method: 'get',
        params: data
    });
}
// 营销报表
export function marketingdatadialogueselect(data) {
    return request({
        url: '/v1/marketing/data/dialogue-select',
        method: 'get',
        params: data
    });
}
// 删除对话列表
export function marketingdatadeletedialogue(data) {
    return request({
        url: '/v1/marketing/data/delete-dialogue',
        method: 'post',
        data
    });
}
// 消费列表保存消费老数据
export function saveConsume(data) {
    return request({
        url: 'v1/marketing/consume/save-consume',
        method: 'post',
        data
    });
}
// 
// 
// 渠道配置中的基建配置
// 基建配置列表
export function constructList(data) {
    return request({
        url: '/v1/marketing/construct/construct-list',
        method: 'get',
        params: data
    });
}
// 新建/编辑基建
export function updateConstruct(data) {
    return request({
        url: '/v1/marketing/construct/update-construct',
        method: 'post',
        data
    });
}
// 删除基建
export function deleteConstruct(data) {
    return request({
        url: '/v1/marketing/construct/delete-construct',
        method: 'post',
        data
    });
}
// 基建费用-渠道筛选
export function selectChannel(data) {
    return request({
        url: 'v1/marketing/construct/select-channel',
        method: 'get',
        params: data
    });
}
//
//
// 渠道配置中渠道费用录入类型
// 渠道费用录入类型列表
export function channeltypeList(data) {
    return request({
        url: '/v1/marketing/consume/channel-type-list',
        method: 'get',
        params: data
    });
}
// 编辑渠道费用录入类型
export function updatechannelType(data) {
    return request({
        url: '/v1/marketing/consume/update-channel-type',
        method: 'post',
        data
    });
}
// 消费录入基建费用
// 基建列表
export function constructConsume(data) {
    return request({
        url: '/v1/marketing/construct/construct-consume',
        method: 'get',
        params: data
    });
}
// 新增、编辑基建消费
export function updateconsumeRecord(data) {
    return request({
        url: '/v1/marketing/construct/update-consume-record',
        method: 'post',
        data
    });
}
// 渠道下拉筛选
export function conditionList(data) {
    return request({
        url: '/v1/marketing/construct/condition-list',
        method: 'get',
        params: data
    });
}
// 删除基建费用记录
export function deleteconsumeRecord(data) {
    return request({
        url: '/v1/marketing/construct/delete-consume-record',
        method: 'post',
        data
    });
}
// 周期消费列表
export function consumecycleList(data) {
    return request({
        url: '/v1/marketing/consume/consume-cycle-list',
        method: 'get',
        params: data
    });
}
// 新增编辑周期消费
export function updateconsumeCycle(data) {
    return request({
        url: '/v1/marketing/consume/update-consume-cycle',
        method: 'post',
        data
    });
}
// /删除周期营销费用
export function deleteonsumeCycle(data) {
    return request({
        url: '/v1/marketing/consume/delete-consume-cycle',
        method: 'post',
        data
    });
}
// 周期消费重复存在录入
export function checkconsumeCycle(data) {
    return request({
        url: '/v1/marketing/consume/check-consume-cycle',
        method: 'post',
        data
    });
}
// 删除日消费
export function deleteCconsume(data) {
    return request({
        url: '/v1/marketing/consume/delete-consume',
        method: 'post',
        data
    });
}
//
//
// 对帐单
//  实批金额列表
export function moneyList(data) {
    return request({
        url: '/v1/marketing/dingtalk/money-list',
        method: 'get',
        params: data
    });
}
// 账单列表
export function monthBill(data) {
    return request({
        url: '/v1/marketing/dingtalk/month-bill',
        method: 'get',
        params: data
    });
}
// 对账单列表
export function billList(data) {
    return request({
        url: '/v1/marketing/dingtalk/bill-list',
        method: 'get',
        params: data
    });
}
// 对账单详情
export function billInfo(data) {
    return request({
        url: '/v1/marketing/dingtalk/bill-info',
        method: 'get',
        params: data
    });
}
// 生成对账单
export function createDill(data) {
    return request({
        url: '/v1/marketing/dingtalk/create-bill',
        method: 'post',
        data
    });
}
// 项目筛选项
export function netreportprojectcondition(data) {
    return request({
        url: '/v1/net/report/project-condition',
        method: 'get',
        params: data
    });
}
// 月账单筛选条件
export function monthbillCondition(data) {
    return request({
        url: 'v1/marketing/dingtalk/month-bill-condition',
        method: 'get',
        params: data
    });
}
// 一级渠道
export function getPchannel(data) {
    return request({
        url: '/v1/marketing/data/get-pchannel',
        method: 'get',
        params: data
    });
}
// 编辑对话列表
export function dialogueEdit(data) {
    return request({
        url: '/v1/marketing/data/dialogue-edit',
        method: 'post',
        data
    });
}
// 营销报表【改版】
export function netmarketList(data) {
    return request({
        url: 'v1/report/net-market/list',
        method: 'get',
        params: data
    });
}
